/**
 * Copyright (c) 2005-2008 旭鸣软件
 * All rights reserved. 
 */
/**
 * File：PageObjectSet.java
 * History:
 *       2010-5-25: Initially created, tangkf.
 */
package com.xteam.ecsystem.dao.page;

import java.io.Serializable;
import java.util.List;

/**
 * 分页处理的对象集合
 * 其中包含两部分内容：
 * 1. 分页信息本身，用来描述分页的相关参数
 * 2. 对象集合，代表了按分页参数取得的对象集合
 * 当返回的时候才不至于只返回了对象集合而没有分页的相关信息
 * @author tangkf
 */
public class PageObjectSet<E> implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	private int fIndex		= 0;
	private int pageSize	= 30;
	private long rowCount	= 0;
	private int pageCount	= 0;

	private Page pageInfo		= new PageInfo();
	
	private List<E> resultList	= null;
	
	public PageObjectSet(){
	}
	
	public PageObjectSet(long count, List<E> list){
		this.rowCount	= count;
		this.resultList	= list;
	}
	
	/**
	 * @return 属性pageInfo的值.
	 */
	public Page getPageInfo() {
		return this.pageInfo;
	}
	/**
	 * @param pageInfo 属性pageInfo.
	 */
	public void setPageInfo(Page pageInfo) {
		this.pageInfo = pageInfo;
		this.fIndex	= this.pageInfo.getFirstRow();
		this.pageSize	= this.pageInfo.getPageSize();
		this.rowCount= this.pageInfo.getRowsCount();
		this.pageCount= this.pageInfo.getPageCount();
	}
	/**
	 * @return 属性resultList的值.
	 */
	public List<E> getResultList() {
		return this.resultList;
	}
	
	/**
	 * @param resultList 属性resultList.
	 */
	public void setResultList(List<E> resultList) {
		this.resultList = resultList;
	}
	/**
	 * @return 属性fIndex的值.
	 */
	public int getfIndex() {
		return this.fIndex;
	}
	/**
	 * @param fIndex 属性fIndex.
	 */
	public void setfIndex(int fIndex) {
		this.fIndex = fIndex;
	}
	/**
	 * @return 属性pageSize的值.
	 */
	public int getPageSize() {
		return this.pageSize;
	}
	/**
	 * @param pageSize 属性pageSize.
	 */
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	/**
	 * @return 属性rowCount的值.
	 */
	public long getRowCount() {
		return this.rowCount;
	}
	/**
	 * @param rowCount 属性rowCount.
	 */
	public void setRowCount(long rowCount) {
		this.rowCount = rowCount;
	}
	/**
	 * @return 属性pageCount的值.
	 */
	public int getPageCount() {
		return this.pageCount;
	}
	/**
	 * @param pageCount 属性pageCount.
	 */
	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}

}
